import {
    BrowserRouter as Router,
    Routes,
    Route,
} from 'react-router-dom'
import App from '../App'
import {routes} from './routes.jsx'

// import Home from '../page/home'
// import Resource from '../page/home/resource'
// import Broadcast from '../page/home/broadcast'
// import Group from '../page/home/group'
// import Examine from '../page/home/examine'
// import Order from '../page/home/order'
// import Help from '../page/home/help'
// import Agent from '../page/home/agent'
// import Login from '../page/login'

const RouterView=()=>{
    return (
    <Router>
        <App>
            <Routes>
                {
                    routes.map(item=>{
                        return <Route key={item.path} path={item.path} element={item.element}>
                            {
                                item.children?.map(item1=>{
                                    return <Route key={item1.path} path={item1.path} element={item1.element}>
                                        {
                                            item1.children?.map(item2=>{
                                                return <Route key={item2.path} path={item2.path} element={item2.element}></Route>
                                            })
                                        }
                                    </Route>
                                })
                            }
                        </Route>
                    })
                }
            </Routes>
        </App>
    </Router>
    )
}

export default RouterView